<?php // -*-php-*-
rcs_id('');
?>
<?php /* I would like not to have to use these tables, and managed to
       * get this stuff to work more or less correctly using
       * CSSs float:left; and float:right;.  However float:right; seems
       * to cause MSIE4.01/NT to hang. 
       * So, we use tables...  */ ?>
<table summary="Toolbar 1: Page actions and user login."
       width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="baseline">
  <td>
  <div id="actionbuttons">
    <?php 
// To be able to edit :
//  - page is not locked and:
//     + you are anonymous and anonymous can edit
//    or
//     + you are not anonymous
// or
//  - you are admin
if (
    (
     !$page->get('locked') &&
     (
      (!$user->isAuthenticated() && ALLOW_ANON_EDIT) ||
      $user->isAuthenticated()
      )
     ) ||
    $user->isAdmin()
    )
{ ?>
      <?= Button("edit", $revision->isCurrent() ? _("Edit") : _("Edit Old Revision")) ?>
    <?php } else { ?>
      <?= Button("viewsource", _("View Source")) ?>
    <?php } ?>
    <?php if ($user->isAdmin() or mayAccessPage('change', $page->getName())) { ?>
      <?=$SEP?><?= Button($page->get('locked') ? 'unlock' : 'lock') ?>
    <?php if (false && (ENABLE_PAGEPERM and mayAccessPage('change', $page->getName()))) { ?>
      <?=$SEP?><?= Button('chown') ?>
      <?=$SEP?><?= Button('setacl') ?>
    <?php }} ?>
    <?php if (display_remove_button($page->getName()) && ($user->isAdmin() or mayAccessPage('remove', $page->getName()))) { ?>
      <!--<?=$SEP?><?= Button('revert',_("Revert"), $revision->isCurrent() ? $page->GetRevisionBefore() : $revision) ?>-->
      <?=$SEP?><?= Button('remove') ?>
    <?php } ?>
    <?=$SEP?><?= Button("PageHistory", _("PageHistory")) ?>
    <?=$SEP?><?= Button("diff") ?> 
    <?=$SEP?><?= Button("PageInfo", _("PageInfo")) ?>
<?php if (false && ((DEBUG and $request->getArg('action') == 'browse') || $user->isAdmin())) { ?> 
    <!-- Buttons really only for debugging -->
    <?=$SEP?><?= Button("DebugInfo", _("DebugInfo")) ?>
    <?=$SEP?><?= Button("PageDump", _("PageDump")) ?>
<?php
    if (DEBUG & _DEBUG_SQL and USECACHE) {
      $PurgeCache = Button(array('nocache' => 'purge'),
                     _("PurgeHtmlCache"), $page->getName());
      $PurgeCache->addTooltip(_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed."));
?>
      <?=$SEP?><?= $PurgeCache ?>
<?php } ?>
    <!-- End debugging buttons -->
<?php } ?>
<?php if (defined('USE_EXTERNAL_HTML2PDF') and USE_EXTERNAL_HTML2PDF) { ?> 
    <?=$SEP?><?= Button("pdf") ?>
<?php } ?>
  </div>
  </td>
<?php if (empty($NOSIGNIN)) { ?>
<?php
/* valign="top" is not ideal here but required to get reasonable alignment
   with the other action buttons in some browsers, like OmniWeb and Safari
   (therefore probably Konquorer too) */ ?>
  <td align="right" valign="top">
    <div id="signin"><?= Template('signin') ?></div>
  </td>
<?php } ?>
</tr>
</table>
